package com.holdtime.jtt809dataservice.common.codec;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;
import protocol.jtt809.JTT809Packet;

/**
 *  author: sunwei
 *  Date: 2025/3/14 17:30
 *  Description:
 */ 
public class JTT809Encoder extends MessageToByteEncoder<JTT809Packet<?>> {
    @Override
    protected void encode(ChannelHandlerContext ctx, JTT809Packet<?> packet, ByteBuf out) throws Exception {
        byte[] array = packet.array();
        out.writeBytes(array);
    }
}
